import {Drawer, DrawerProps} from "antd";
import * as React from "react";
import {CSSProperties, ReactNode} from "react";
import {util} from "@/common/util";
 

export type HDrawerProps = {
    onClose: () => void;
    open: boolean;
    bodyStyle?: CSSProperties;
    title: ReactNode;
    style?: CSSProperties;
    maskClosable?: boolean;
    children: ReactNode;
    width?: string | number;
}




export default class AuthButton extends React.Component<DrawerProps, any> {
    state: { style?: CSSProperties, bodyStyle?: CSSProperties } = {}

    // eslint-disable-next-line @typescript-eslint/no-useless-constructor
    constructor(props: HDrawerProps) {
        super(props);
    }


    render() {
        const {
            maskClosable = true,
            open,
            title,
            footer,
            onClose,
            children,
        } = this.props;

        return <Drawer
        maskClosable={maskClosable}
        open={open}
        width={this.props.width}
        bodyStyle={this.state.bodyStyle}
        title={title}
        style={this.state.style}
        footer={footer}
        onClose={onClose}
        >
            {children}
        </Drawer>
    }
}